/**
 * Copyright (C), 2015-2022, 开度
 * FileName: MysqlTest
 * Author:   ASUS
 * Date:     2022/6/27 17:43
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * Hezeyu           2022/6/27           1.0
 */
package com.example.spring.security.mysql;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.example.spring.security.mysql.utils.JDBCUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

/**
 * 〈〉
 *
 * @author Hezeyu
 * @create 2022/6/27
 * @since 1.0.0
 */
public class MysqlTest {


    public static void main(String[] args) {
        Connection conn = null;
        PreparedStatement pstm = null;
        ResultSet rs = null;

        try {
            //获取连接
            conn = JDBCUtil.getConn();
            //书写SQL
            String sql = "select * from product_line_category_detail";
            pstm = conn.prepareStatement(sql);
            rs = pstm.executeQuery();
            while (rs.next()) {
                System.out.println(JSONObject.toJSONString(rs.getObject("id")));
            }
        }catch (Exception e) {

        }finally {
            JDBCUtil.close(rs, pstm, null);
        }
    }



}
